package com.genesis.yunnanji.adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.genesis.yunnanji.R;
import com.genesis.yunnanji.bean.TouristBean;
import com.genesis.yunnanji.config.GenesisApiConfig;
import com.lidroid.xutils.BitmapUtils;

import java.util.List;


public class TouristAdapter extends BaseQuickAdapter<TouristBean.ResultBean.ListBean, BaseViewHolder> {
    private Context context;

    public TouristAdapter(Context context, @Nullable List<TouristBean.ResultBean.ListBean> data) {
        super(R.layout.layout_tourist_item, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, TouristBean.ResultBean.ListBean item) {
        BitmapUtils bitmapUtils = new BitmapUtils(context);
        bitmapUtils.display(helper.getView(R.id.iv_touristitem_iv), GenesisApiConfig.PIC_HOST + item.getCover_img());
        helper.setText(R.id.tv_touristitem_title, item.getTitle());
    }
}
